<?php

class Custom_Form_CreateUser extends Custom_Form_Abstract{
	public function init(){
		$this->addElement('text', 'username', array(
			'filters'	=>	array(
				'StringTrim',
			),
			'validators'	=>	array(
				'EmailAddress'
			),
            'decorators' => $this->elementDecorators,
            'label'       => 'Username:',
        	'required'	=>	true
        ));
        
        $this->addElement('password', 'password', array(
            'decorators' => $this->elementDecorators,
        	'validators'	=>	array(
        		'NotEmpty'
        	),
            'label'       => 'Password:',
        	'required'	=>	true
        ));
        
        $this->addElement('password', 'confirmPassword', array(
        	'validators' => array(
        			array('identical', false, array('token' => 'password')),
        			'NotEmpty',
    		),
            'decorators' => $this->elementDecorators,
            'label'       => 'Confirm Password:',
        	'required'	=>	true
        ));
        
        $this->addElement('text', 'firstName', array(
        	'validators'	=>	array(
        		'NotEmpty'
        	),
            'decorators' => $this->elementDecorators,
            'label'       => 'First Name:',
        	'required'	=>	true
        ));
        
        $this->addElement('text', 'lastName', array(
        	'validators'	=>	array(
        		'NotEmpty'
        	),
            'decorators' => $this->elementDecorators,
            'label'       => 'Last Name:',
        	'required'	=>	true
        ));
        
        $this->addElement('text', 'address1', array(
        	'validators'	=>	array(
        		'NotEmpty'
        	),
            'decorators' => $this->elementDecorators,
            'label'       => 'Address 1:',
        	'required'	=>	true
        ));
        
        $this->addElement('text', 'address2', array(
            'decorators' => $this->elementDecorators,
            'label'       => 'Address 2:',
        	'required'	=>	false
        ));
        
        $this->addElement('text', 'city', array(
        	'validators'	=>	array(
        		'NotEmpty'
        	),
            'decorators' => $this->elementDecorators,
            'label'       => 'City:',
        	'required'	=>	true
        ));
        
        $this->addElement('select', 'state', array(
        	'validators'	=>	array(
        		'NotEmpty'
        	),
            'decorators' => $this->elementDecorators,
            'label'       => 'State:',
        	'multiOptions'	=> 	$this->_stateList,
        	'required'	=>	true
        ));
        
        $this->addElement('text', 'zip', array(
        	'validators'	=>	array(
        		'NotEmpty'
        	),
            'decorators' => $this->elementDecorators,
            'label'       => 'Zip Code:',
        	'required'	=>	true
        ));
        
        $this->addElement('select', 'addressType', array(
        	'validators'	=>	array(
        		'NotEmpty'
        	),
            'decorators' => $this->elementDecorators,
            'label'       => 'Address Type:',
        	'MultiOptions' => $this->_type,
        	'required'	=>	true
        ));
        
        $this->addElement('text', 'contactNumber', array(
        	'validators'	=>	array(
        		'NotEmpty'
        	),
            'decorators' => $this->elementDecorators,
            'label'       => 'Contact:',
        	'required'	=>	true
        ));
        
        $this->addElement('select', 'contactType', array(
        	'validators'	=>	array(
        		'NotEmpty'
        	),
            'decorators' => $this->elementDecorators,
            'label'       => 'Contact Type:',
        	'MultiOptions' => $this->_type,
        	'required'	=>	true
        ));
        
        $this->addElement('select', 'paymentType', array(
        	'validators'	=>	array(
        		'NotEmpty'
        	),
            'decorators' => $this->elementDecorators,
            'label'       => 'PaymentType:',
        	'MultiOptions' => $this->_payType,
        	'required'	=>	true
        ));
        
        $this->addElement('text', 'paymentId', array(
            'decorators' => $this->elementDecorators,
            'label'       => 'Payment Id:',
        	'required'	=>	false
        ));
        
        $this->addElement('submit', 'register', array(
            'decorators' => $this->buttonDecorators,
            'label'       => 'Create New User',
        ));
	}
}